<template>
	<view>
		<view class="list_card_one" @click="qyrz()">
			<view>
				<image src="../../../static/me/enterprise.png" mode="aspectFill"></image>
				<text class="titles">企业认证</text>
				<uni-icons class="icons" type="arrowright" color="#ffffff"></uni-icons>
				<text class="more">More</text>
			</view>
			<view class="bottom">
				<text class="status">{{qy}}</text>
				<text class="english">Enterprise Certification</text>
			</view>
		</view>
		<view class="list_card_one list_card_two" @click="sjrz()">
			<view>
				<image src="../../../static/me/business.png" mode="aspectFill"></image>
				<text class="titles">商家认证</text>
				<uni-icons class="icons" type="arrowright" color="#ffffff"></uni-icons>
				<text class="more">More</text>
			</view>
			<view class="bottom">
				<text class="status">{{sj}}</text>
				<text class="english">Merchant Authentication</text>
			</view>
		</view>
		<view class="list_card_one list_card_three" @click="smrz">
			<view>
				<image src="../../../static/me/Real_name.png" mode="aspectFill"></image>
				<text class="titles">实名认证</text>
				<uni-icons class="icons" type="arrowright" color="#ffffff"></uni-icons>
				<text class="more">More</text>
			</view>
			<view class="bottom">
				<text class="status">{{sm}}</text>
				<text class="english">Real Name Authentication</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				"title": "",
				verifyToken: '45346456',
				code: '', //登录状态
				msg: '', // 错误信息
				data: [], // 数据
				qy: '未认证',
				sj: '未认证',
				sm: '未认证',
			}
		},
		onLoad() {
			this.goAttent()
		},
		methods: {
			goAttent() {
				var that = this
				that.$http.req.ajax({
					path: ':8066/web/lxUser/getUserRna',
					header: {
						'token': uni.getStorageSync('token')
					},
					afterAjax: (res) => {
						console.log(res, '后台拿取用户验证状态')
						that.data = res.data
						// if(that.data!=''){
						// 		that.data.forEach((item, index) => {
						// 			if (item.rnaState == '1') {
						// 				this.$set(item, 'status', '已通过')
						// 			} else if (item.rnaState == '2') {
						// 				this.$set(item, 'status', '已驳回')
						// 			} else if (item.rnaState == '0') {
						// 				this.$set(item, 'status', '申请中')
						// 			}
						// 		})
						// }
						if(that.data!=''){
							that.data.forEach((el)=>{
								if(el.rnaType == 1){
									if(el.rnaState==0){
										this.sm='申请中'
									}else if(el.rnaState==1){
										this.sm='已认证'
									}else if(el.rnaState==2){
										this.sm='已驳回'
									}
								}else if(el.rnaType == 2){
									if(el.rnaState==0){
										this.sj='申请中'
									}else if(el.rnaState==1){
										this.sj='已认证'
									}else if(el.rnaState==2){
										this.sj='已驳回'
									}
								}else if(el.rnaType == 3){
									if(el.rnaState==0){
										this.qy='申请中'
									}else if(el.rnaState==1){
										this.qy='已认证'
									}else if(el.rnaState==2){
										this.qy='已驳回'
									}
								}
							})
						}
					}
				})
			},
			smrz() {
				uni.navigateTo({
					url:'name_authentication'
				})
			},
			qyrz() {
				uni.navigateTo({
					url: 'enterprise_certification?pages='+this.qy
				})
			},
			sjrz() {
				// uni.navigateTo({
				// 	url:'business'
				// })
				uni.navigateTo({
					url: 'merchant_authentication?pages='+this.sj
				})
			}
		},

	}
</script>

<style>
	.list_card_one {
		width: 699rpx;
		height: 217rpx;
		background: linear-gradient(132deg, #146FCC 0%, #34BFE0 100%);
		opacity: 1;
		border-radius: 28rpx;
		margin-top: 25rpx;
		margin-left: 25rpx;
	}

	.list_card_one image {
		width: 57rpx;
		height: 57rpx;
		margin-top: 28rpx;
		margin-left: 32rpx;
		float: left;
	}

	.titles {
		font-size: 28rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #FFFFFF;
		opacity: 1;
		padding-top: 38rpx;
		padding-left: 18rpx;
		float: left;
	}

	.more {
		float: right;
		margin-top: 36rpx;
		font-size: 21rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: #FFFFFF;
		opacity: 1;
	}

	.icons {
		float: right;
		margin-top: 36rpx;
		margin-right: 34rpx;
	}

	.status {
		font-size: 21rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: #FFFFFF;
		opacity: 1;
	}

	.english {
		font-size: 21rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: #FFFFFF;
		opacity: 0.56;
		float: right;
		margin-right: 32rpx;
	}

	.bottom {
		display: block;
		padding-top: 157rpx;
		padding-left: 32rpx;
	}

	.list_card_two {
		width: 699rpx;
		height: 217rpx;
		background: linear-gradient(132deg, #E64718 0%, #FFDB46 100%);
		opacity: 1;
		border-radius: 28rpx;
		margin-top: 25rpx;
		margin-left: 25rpx;
	}

	.list_card_three {
		width: 699rpx;
		height: 217rpx;
		background: linear-gradient(132deg, #262017 0%, #3B361C 100%);
		opacity: 1;
		border-radius: 28rpx;
		margin-top: 25rpx;
		margin-left: 25rpx;
	}
</style>
